package com.jiayi.data.converter;

import java.util.Date;
import com.jiayi.data.entity.schema.JiayiNewsType;
import com.jiayi.data.entity.excel.JiayiNewsTypeExcel;
import com.jiayi.data.entity.bo.JiayiNewsTypeBO;
import com.jiayi.data.entity.request.JiayiNewsTypeRequest;
import com.jiayi.data.entity.request.JiayiNewsTypeSearchRequest;
import com.jiayi.data.entity.request.JiayiNewsTypeSearchPageRequest;
import com.jiayi.data.entity.response.JiayiNewsTypeDTO;
import org.springframework.stereotype.Component;

/**
 * 新闻动态类型对象 Converter
 *
 * @author zzx
 * @date 2024-11-26
 */
@Component
public class JiayiNewsTypeConverter {

    public JiayiNewsType convertToJiayiNewsType(JiayiNewsTypeBO from) {
        if (from == null) {
            return null;
        }
        JiayiNewsType to = new JiayiNewsType();
        to.setId(from.getId());
        to.setName(from.getName());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiNewsTypeBO convertToJiayiNewsTypeBO(JiayiNewsTypeSearchRequest from) {
        if (from == null) {
            return null;
        }
        JiayiNewsTypeBO to = new JiayiNewsTypeBO();
            to.setId(from.getId());
            to.setName(from.getName());
            to.setRemark(from.getRemark());
            to.setCreateBy(from.getCreateBy());
            to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiNewsTypeBO convertToJiayiNewsTypeBO(JiayiNewsTypeRequest from) {
        if (from == null) {
            return null;
        }
        JiayiNewsTypeBO to = new JiayiNewsTypeBO();
            to.setId(from.getId());
            to.setName(from.getName());
            to.setRemark(from.getRemark());
            to.setCreateBy(from.getCreateBy());
            to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiNewsTypeBO convertToJiayiNewsTypeBO(JiayiNewsType from) {
        if (from == null) {
            return null;
        }
        JiayiNewsTypeBO to = new JiayiNewsTypeBO();
        to.setId(from.getId());
        to.setName(from.getName());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiNewsType convertToJiayiNewsType(JiayiNewsTypeRequest from) {
        if (from == null) {
            return null;
        }
        JiayiNewsType to = new JiayiNewsType();
        to.setId(from.getId());
        to.setName(from.getName());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiNewsType convertToJiayiNewsType(JiayiNewsTypeSearchPageRequest from) {
        if (from == null) {
            return null;
        }
        JiayiNewsType to = new JiayiNewsType();
            to.setId(from.getId());
            to.setName(from.getName());
            to.setRemark(from.getRemark());
            to.setCreateBy(from.getCreateBy());
            to.setCreateTime(from.getCreateTime());
        return to;
    }

public JiayiNewsType convertToJiayiNewsType(JiayiNewsTypeSearchRequest from) {
        if (from == null) {
            return null;
        }
        JiayiNewsType to = new JiayiNewsType();
            to.setId(from.getId());
            to.setName(from.getName());
            to.setRemark(from.getRemark());
            to.setCreateBy(from.getCreateBy());
            to.setCreateTime(from.getCreateTime());
        return to;
    }
    public JiayiNewsTypeDTO convertToJiayiNewsTypeDTO(JiayiNewsTypeBO from) {
        if (from == null) {
            return null;
        }
        JiayiNewsTypeDTO to = new JiayiNewsTypeDTO();
        to.setId(from.getId());
        to.setName(from.getName());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiNewsTypeDTO convertToJiayiNewsTypeDTO(JiayiNewsType from) {
        if (from == null) {
            return null;
        }
            JiayiNewsTypeDTO to = new JiayiNewsTypeDTO();
            to.setId(from.getId());
            to.setName(from.getName());
            to.setRemark(from.getRemark());
            to.setCreateBy(from.getCreateBy());
            to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiNewsTypeExcel convertToJiayiNewsTypeExcel(JiayiNewsType from) {
        if (from == null) {
            return null;
        }
            JiayiNewsTypeExcel to = new JiayiNewsTypeExcel();
            to.setId(from.getId());
            to.setName(from.getName());
            to.setRemark(from.getRemark());
            to.setCreateBy(from.getCreateBy());
            to.setCreateTime(from.getCreateTime());
        return to;
    }


}